<template>
  <div class="container" ref="spell">
    <div class="spell">
      <div class="header">
        <img class="back" src="./icons/head-back.png" alt="" @click="back">
        <div class="icons">
          <img src="./icons/icon.png" alt="">
        </div>
        <div class="font">
          <span></span>
          <span></span>
          <p>生活用纸榜</p>
        </div>
        <p class="sell">本榜单已拼19.6万件</p>
      </div>
      <div class="center">
        <div class="center-top">
          <img class="left" src="./icons/top.jpg" alt="">
          <div class="right">
            <p>快乐狗婴儿手口专用80抽湿巾纸</p>
            <div class="right-spells">
              <span class="big-font"><span>￥</span>3.9</span>
              <span class="small-font">￥19</span>
              <img src="./icons/ping.png" alt="">
            </div>
          </div>
          <img class="position" src="./icons/tuijian.png" alt="">
        </div>
        <div class="center-top">
          <img class="left" src="./icons/top.jpg" alt="">
          <div class="right">
            <p>快乐狗婴儿手口专用80抽湿巾纸</p>
            <div class="right-font">
              <img src="./icons/hot.png" alt="">
            </div>
            <div class="right-spell">
              <span class="big-font"><span>￥</span>3.9</span>
              <span class="small-font">￥19</span>
              <img src="./icons/ping.png" alt="">
            </div>
          </div>
          <div class="top">
            <p>1</p>
          </div>
        </div>
        <div class="center-top">
          <img class="left" src="./icons/top.jpg" alt="">
          <div class="right">
            <p>快乐狗婴儿手口专用80抽湿巾纸</p>
            <div class="right-font">
              <img src="./icons/hot.png" alt="">
            </div>
            <div class="right-spell">
              <span class="big-font"><span>￥</span>3.9</span>
              <span class="small-font">￥19</span>
              <img src="./icons/ping.png" alt="">
            </div>
          </div>
          <div class="top">
            <p>2</p>
          </div>
        </div>
        <div class="center-top">
          <img class="left" src="./icons/top.jpg" alt="">
          <div class="right">
            <p>快乐狗婴儿手口专用80抽湿巾纸</p>
            <div class="right-font">
              <img src="./icons/hot.png" alt="">
            </div>
            <div class="right-spell">
              <span class="big-font"><span>￥</span>3.9</span>
              <span class="small-font">￥19</span>
              <img src="./icons/ping.png" alt="">
            </div>
          </div>
          <div class="top">
            <p>3</p>
          </div>
        </div>
        <div class="center-top">
          <img class="left" src="./icons/top.jpg" alt="">
          <div class="right">
            <p>快乐狗婴儿手口专用80抽湿巾纸</p>
            <div class="right-font">
              <img src="./icons/hot.png" alt="">
            </div>
            <div class="right-spell">
              <span class="big-font"><span>￥</span>3.9</span>
              <span class="small-font">￥19</span>
              <img src="./icons/ping.png" alt="">
            </div>
          </div>
          <div class="top">
            <p>4</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import BScroll from 'better-scroll'
export default {
  name: 'spell',
  methods: {
    back () {
      this.$router.push({path: '/home'})
    }
  },
  mounted () {
    this.$nextTick(() => {
      let spell = this.$refs.spell
      let scroll = new BScroll(spell, {
        click: true,
        scrollY: true,
        bounce: false
      })
      return scroll
    })
  }
}
</script>

<style scoped lang="scss">
  .container{
    width: 100vw;
    height: 100vh;
    .spell{
      width: 100vw;
      height: 130vh;
      .header{
        height: 760px;
        background: url("./icons/pg_bg.fb68b1c.png");
        background-size: cover;
        color: #fff;
        .back{
          width: 65px;
          height: 65px;
          padding: 36px 0 0 45px;
        }
        .icons{
          margin: 50px 0 80px 520px;
          img{
            width: 216px;
            display: block;
          }
        }
        .font{
          position: relative;
          span{
            position: absolute;
            width: 18px;
            height: 18px;
            display: inline-block;
            background: #fff;
            border-radius: 50%;
          }
          span:nth-child(1){
            top: 60px;
            left: 345px;
          }
          span:nth-child(2){
            top: 60px;
            right: 345px;
          }
          p{
            text-align: center;
            font-size: 90px;
          }
        }
        .sell{
          width: 465px;
          height: 66px;
          font-size: 45px;
          text-align: center;
          margin: 50px 0 0 390px;
          background: #5e5959;
          border-radius: 30px;
        }
      }
      .center{
        position: absolute;
        top: 600px;
        width: 1164px;
        overflow: hidden;
        display: inline-block;
        margin-left: 42px;
        .center-top{
          height: 430px;
          background: #fff;
          border-radius: 40px;
          display: flex;
          margin-bottom: 20px;
          .left{
            width: 320px;
            height: 320px;
            margin: 40px 50px 0 40px;
          }
          .right{
            p{
              margin-top: 40px;
              width: 580px;
              text-indent: 20px;
              font-size: 40px;
            }
            .right-font{
              img{
                width: 430px;
                margin-top: 60px;
              }
            }
            .right-spells{
              margin-top: 100px;
              .big-font{
                font-size: 55px;
                color: #eb4f3f;
                margin-right: 35px;
                span{
                  font-size: 32px;
                }
              }
              .small-font{
                font-size: 32px;
                text-decoration: line-through;
                color: #d8d8d8;
              }
              img{
                width: 132px;
                height: 72px;
                position: absolute;
                right: 0;
              }
            }
            .right-spell{
              width: 742px;
              margin-top: 20px;
              position: relative;
              .big-font{
                font-size: 55px;
                color: #eb4f3f;
                margin-right: 35px;
                span{
                  font-size: 32px;
                }
              }
              .small-font{
                font-size: 32px;
                text-decoration: line-through;
                color: #d8d8d8;
              }
              img{
                width: 132px;
                height: 72px;
                position: absolute;
                right: 0;
              }
            }
          }
          .position{
            width: 190px;
            height: 70px;
            position: absolute;
            left: 0;
            top: 20px;
          }
          .top{
            background: url("./icons/bangdan.png") no-repeat;
            background-size: 100% 100%;
            position: absolute;
            left: 10px;
            width: 72px;
            line-height: 80px;
            text-align: center;
            color: #fff;
            font-size: 36px;
          }
        }
      }
    }
  }
</style>
